<script setup>
import Son1 from "@/components/5兄弟组件传参/1.子组件1.vue"
import Son2 from "@/components/5兄弟组件传参/2.子组件2.vue"

import {ref} from "vue";
// 要想实现兄弟组件传参
// 思路：
//1.先从一个子组件通过事件传递将数据从子组件传递给父组件
//2.在从父组件通过属性传递将数据从父组件传递给子组件
let msg = ref('')

function receiver(data) {
  msg.value = data
}


</script>

<template>
  <Son1 @say-hello="receiver"/>
  <Son2 :msg/>
  {{ msg }}
</template>


<style scoped>

</style>
